#pragma once
#include<iostream>
using namespace std;
namespace hcc
{
    template<class Iterator,class ref,class ptr>
    struct reve_iterator
    {
        typedef reve_iterator<Iterator,ref,ptr> riterator;
        Iterator It;
        reve_iterator(Iterator it)
            :It(it)
        {}
        riterator& operator++()
        {
            It--;
            return *this;
        }
        riterator operator++(int)
        {
            Iterator tem(It);
            It--;
            return tem; 
        }
        riterator& operator--()
        {
            It++;
            return *this;
        }
        riterator operator--(int)
        {
            Iterator tem(It);
            It++;
            return tem;
        }
        bool operator!=(const riterator& x)const
        {
            return It!=x.It;
        }
        bool operator==(const riterator& x)const
        {
            return !(*this!=x);
        }
        ref operator*()const
        {
            Iterator tem(It);
            return *(--tem);
        }
        ptr operator->()const
        {
            return &(*It);
        }
    };
}
